package com.lovo.service.impl;

import com.lovo.dao.ClassBeanDAO;
import com.lovo.model.ClassBean;
import com.lovo.service.ClassBeanService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ClassBeanServiceImpl implements ClassBeanService {
    @Resource
    private ClassBeanDAO classBeanDAO;

    @Override
    public List<ClassBean> findAll() {
        return classBeanDAO.findAll();
    }

    @Override
    public ClassBean findByClassId(Integer classId) {
        return classBeanDAO.findByClassId(classId);
    }

    @Override
    public void addClassBean(ClassBean classBean) {
        classBeanDAO.save(classBean);
    }

    @Override
    public void update(ClassBean classBean) {
        classBeanDAO.save(classBean);
    }

    @Override
    public void del(ClassBean classBean) {
        classBeanDAO.delete(classBean);
    }
}
